package com.deepglint.transform;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author mj
 * @version 1.0
 * @date 2021-11-16 0:02
 */
public class TransformTest_Partition {
    public static void main(String[] args) throws Exception{
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(4);

        String inputPath = "C:\\Users\\马军\\Desktop\\Idea-workspace\\flink\\src\\main\\resources\\source.txt";
        DataStream<String> inputStream = env.readTextFile(inputPath);

//        inputStream.print();

        //1.shuffle
        DataStream<String> shuffleStream = inputStream.shuffle();

//        shuffleStream.print();

        //2.global
        inputStream.global().print();

        env.execute();
    }
}
